﻿using Microsoft.Data.Edm;
using System;
using System.Collections.Generic;
namespace Microsoft.Data.OData.Metadata
{
    /// <summary>
    /// Class responsible for determining the entity type of an entity set.
    /// </summary>
    internal abstract class EdmTypeResolver
    {
        /// <summary>
        /// Returns the element type of the given entity set.
        /// </summary>
        /// <param name="entitySet">The entity set to get the element type of.</param>
        /// <returns>The <see cref="T:Microsoft.Data.Edm.IEdmEntityType" /> representing the element type of the <paramref name="entitySet" />.</returns>
        internal abstract IEdmEntityType GetElementType(IEdmEntitySet entitySet);
        /// <summary>
        /// Returns the return type of the given function import.
        /// </summary>
        /// <param name="functionImport">The function import to get the return type from.</param>
        /// <returns>The <see cref="T:Microsoft.Data.Edm.IEdmType" /> representing the return type fo the <paramref name="functionImport" />.</returns>
        internal abstract IEdmTypeReference GetReturnType(IEdmFunctionImport functionImport);
        /// <summary>
        /// Returns the return type of the given function import group.
        /// </summary>
        /// <param name="functionImportGroup">The function import group to get the return type from.</param>
        /// <returns>The <see cref="T:Microsoft.Data.Edm.IEdmType" /> representing the return type fo the <paramref name="functionImportGroup" />.</returns>
        internal abstract IEdmTypeReference GetReturnType(IEnumerable<IEdmFunctionImport> functionImportGroup);
        /// <summary>
        /// Gets the function parameter type.
        /// </summary>
        /// <param name="functionParameter">The function parameter to get the type for.</param>
        /// <returns>The <see cref="T:Microsoft.Data.Edm.IEdmTypeReference" /> representing the type on the function parameter; or null if no such type could be found.</returns>
        internal abstract IEdmTypeReference GetParameterType(IEdmFunctionParameter functionParameter);
    }
}
